//
//  ZTXNewAddressBottomCell.m
//  NtoccShipper
//
//  Created by 张天兴 on 2023/8/31.
//  Copyright © 2023 zhuchongjin. All rights reserved.
//

#import "ZTXNewAddressBottomCell.h"

@implementation ZTXNewAddressBottomCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.staterTimeButton.layer.masksToBounds = YES;
    self.staterTimeButton.layer.cornerRadius = 5;
    self.staterTimeButton.layer.borderColor = [UIColor cjLineColor].CGColor;
    self.staterTimeButton.layer.borderWidth = 1;
    self.endTimeButton.layer.masksToBounds = YES;
    self.endTimeButton.layer.cornerRadius = 5;
    self.endTimeButton.layer.borderColor = [UIColor cjLineColor].CGColor;
    self.endTimeButton.layer.borderWidth = 1;
    [self.noOverButton setImage:[UIImage imageNamed:@"zcj_selectedCir"] forState:(UIControlStateNormal)];
    [self.timeOverButton setImage:[UIImage imageNamed:@"zcj_unSelectedCir"] forState:(UIControlStateNormal)];
    [self.numberOverButton setImage:[UIImage imageNamed:@"zcj_unSelectedCir"] forState:(UIControlStateNormal)];
    self.ciTextField.keyboardType = UIKeyboardTypeNumberPad;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (IBAction)noOverButtonAction:(UIButton *)sender {
    self.block(@"0");
}
- (IBAction)timeOverButtonAction:(UIButton *)sender {
    self.block(@"1");
}
- (IBAction)numberOverButtonAction:(UIButton *)sender {
    self.block(@"2");
}
- (IBAction)stattimeButtonAction:(UIButton *)sender {
    WS(ws);
    BRDatePickerView *datePickerView = [[BRDatePickerView alloc]initWithPickerMode:BRDatePickerModeYMD];
    datePickerView.title = @"开始时间";
    datePickerView.minDate = [NSDate date];
    datePickerView.maxDate = [NSDate br_setYear:2050 month:5 day:1];
    datePickerView.resultBlock = ^(NSString *selectValue) {
        ws.statrTimeBlock(selectValue);
    };
    BRPickerStyle *customStyle = [BRPickerStyle pickerStyleWithThemeColor:[UIColor cjMainColor]];
    datePickerView.pickerStyle = customStyle;
    [datePickerView show];
   
}
- (IBAction)endTimeButtonAction:(UIButton *)sender {
    WS(ws);
    BRDatePickerView *datePickerView = [[BRDatePickerView alloc]initWithPickerMode:BRDatePickerModeYMD];
    datePickerView.title = @"结束时间";
    datePickerView.minDate = [NSDate date];
    datePickerView.maxDate = [NSDate br_setYear:2050 month:5 day:1];
    datePickerView.resultBlock = ^(NSString *selectValue) {
        ws.endTimeBlock(selectValue);
    };
    BRPickerStyle *customStyle = [BRPickerStyle pickerStyleWithThemeColor:[UIColor cjMainColor]];
    datePickerView.pickerStyle = customStyle;
    [datePickerView show];
}

@end
